package com.team.utils;

import com.team.entity.User;

import java.util.Stack;

public class SbTest {

      public static void test(User user){
          user.setName("胡志杰");
      }
      public static void test2(int a){
          a=10;
      }


    public static void main(String [] args){
        Stack<User> userStack = new Stack<>();  //数组
         final User user = new User("胡志敏","男");
        User user1 = new User("hh","女");
        System.out.println(user);  //地址值
        //也是一个副本  指向的
        test(user);
        System.out.print(user.getName());  //胡志杰
        int b=4;
        // b  test2(b) 不是B 本身  B的拷贝

        test2(b);
        System.out.println(b);   //4
        userStack.add(user);
        userStack.add(user1);
        userStack.get(1);

        System.out.println(userStack.get(0));

    }
}
